package yshttp

import (
	"context"
	"gitee.com/kmyss/gf-ex/yscmd"
	"gitee.com/kmyss/gf-ex/yshttp/internal/snowflake"
)

// SFInstance 获取雪花算法单例对象
func SFInstance(name ...string) snowflake.Snowflake {
	return snowflake.Instance(name...)
}

// SFNew 创建一个雪花算法对象
func SFNew(name ...string) snowflake.Snowflake {
	return snowflake.NewSnowflake(name...)
}

// SFFlagWordId 工作ID
func SFFlagWordId(ctx context.Context) *yscmd.Flag {
	return snowflake.FlagWorkId(ctx)
}

func SFFlagWordIdBuilder(ctx context.Context) yscmd.IFlagBuilder {
	return &snowflake.FlagWorkIdBuilder{}
}

func SFFlagBaseTime(ctx context.Context) *yscmd.Flag {
	return snowflake.FlagBaseTime(ctx)
}

func SFFlagBaseTimeBuilder(ctx context.Context) *yscmd.Flag {
	return snowflake.FlagBaseTime(ctx)
}
